import request from "@/utils/request";

export function getBankTypes(paramters) {
  return request({
    url: "api/v1/banktypes",
    method: "get",
    params: paramters,
    financeServer: true,
  });
}

export function getBankType(id) {
  return request({
    url: "api/v1/banktypes/" + id,
    method: "get",
    financeServer: true,
  });
}

export function addBankType(data) {
  return request({
    url: "api/v1/banktypes",
    method: "post",
    data: data,
    financeServer: true,
  });
}

export function updateBankType(data) {
  return request({
    url: "api/v1/banktypes",
    method: "put",
    data: data,
    financeServer: true,
  });
}

export function deleteBankType(id) {
  return request({
    url: "api/v1/banktypes/" + id,
    method: "delete",
    financeServer: true,
  });
}

export function getBankAccounts(paramters) {
  return request({
    url: "api/v1/bankaccounts",
    method: "get",
    params: paramters,
    financeServer: true,
  });
}

export function getBankAccount(id) {
  return request({
    url: "api/v1/bankaccounts/" + id,
    method: "get",
    financeServer: true,
  });
}

export function addBankAccount(data) {
  return request({
    url: "api/v1/bankaccounts",
    method: "post",
    data: data,
    financeServer: true,
  });
}

export function updateBankAccount(data) {
  return request({
    url: "api/v1/bankaccounts/" + data.id,
    method: "put",
    data: data,
    financeServer: true,
  });
}

export function deleteBankAccount(id) {
  return request({
    url: "api/v1/bankaccounts/" + id,
    method: "delete",
    financeServer: true,
  });
}
